//
//  SIngletonManager.m
//  DailyTest
//
//  Created by hjk on 16/6/23.
//  Copyright © 2016年 kobehjk. All rights reserved.
//

#import "SingletonManager.h"

@implementation SingletonManager

static id sharedSingle = nil;

+(instancetype )shareInstance
{
    return [[self alloc]init];
}

+(id)allocWithZone:(struct _NSZone *)zone{
    if (sharedSingle == nil) {
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            sharedSingle = [super allocWithZone:zone];
        });
    }
    return sharedSingle;
}

-(id)init
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedSingle = [super init];
    });
    return sharedSingle;
}

+(id)copyWithZone:(struct _NSZone *)zone
{
    return sharedSingle;
}

+(id)mutanleCopyWithZone:(struct _NSZone *)zone
{
    return sharedSingle;
}

@end
